Reservoir fluids sometimes contain substances, such as mercury, that can be harmful to people and to equipment. It can be useful, but challenging, to detect such substances so that prophylactic measures can be taken before the reservoir fluids are produced.